
#ifndef __NTMATRIX2_H
#define __NTMATRIX2_H

#include "NtVector2.h"

namespace NT
{
    template <typename real>
    class NtMatrix2
    {
    public:
        NtMatrix2(bool isZero = true);

        NtMatrix2(const NtMatrix2& mat);

        NtMatrix2(real i00, real i01, real i10, real i11);

        // rowMajor - true  : tuples[0~3] = {00, 01, 10, 11}
        //          - false : tuples[0~3] = {00, 10, 01, 11}
        NtMatrix2(const real tuples[4], bool rowMajor);

        NtMatrix2(const NtVector2<real>& U, const NtVector2<real> V, bool col);

        NtMatrix2(const NtVector2<real>* V, bool isColumn);

        NtMatrix2(real i00, real i11);

        NtMatrix2(real angle);

        // create tensor product
        NtMatrix2(const NtVector2<real>& U, const NtVector2<real>& V);

        static const NtMatrix2 ZERO;
        static const NtMatrix2 IDENTITY;
    private:
        void MakeZeroMatrix();

        void MakeIdentity();

        void MakeDiagonal(real i00, real i11);
    private:
        real m_tuple[4];
    };

#include "NtMatrix2.inl"

    typedef NtMatrix2<float> NtMatrix2f;
    typedef NtMatrix2<double> NtMatrix2d;
}

#endif